package t1;

import java.util.List;

/**
 * 按照专业查询
 *
 */
public class SelectStudentByMajor {
	public void selectStudentByMajor(List<StudentBean> studentList, String major) {
		int i = 0;
		for (StudentBean stu : studentList) {
			if (stu.getMajor().equals(major)) {
				System.out.println(stu.getName() + " " + stu.getMajor());
				i = 1;
			}
		}
		if (i != 1) {
			System.out.println("can not find!");
		}
		System.out.println();
	}
}
